package cn.aitrox.ry.service.image.bean;

import cn.aitrox.ry.bean.RespResult;
import cn.aitrox.ry.service.image.config.ImageNacosProp;
import cn.aitrox.ry.service.image.entity.ImageTransferItemEntity;
import cn.aitrox.ry.util.UUIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;

public abstract class ImageTransferHandler {

    @Autowired
    protected ImageNacosProp imageNacosProp;

    public abstract RespResult handler(ImageTransferItemEntity itemEntity);

    protected String getTmpShareParentPath(String bizType) {
        return StringUtils.joinWith(File.separator, imageNacosProp.getShareDataPath(), "tmp", bizType, UUIDUtil.getUUID());
    }
}
